Image encoding method, image encoding device, image decoding method, and image decoding device

ABSTRACT

For the purpose of providing an image encoding technique for reducing the amount of codes, in inter prediction in which motion search is performed by using a block obtained by dividing an input image and a reference image, the motion vector of the block is predicted by selecting from the motion vectors of the surrounding blocks. Further, in the method of calculating a differential vector and then performing encoding, the number or positions of candidate blocks from which a prediction vector is selected are changed block by block or frame by frame and thereby adaptive and efficient video image compression is performed.

TECHNICAL FIELD

The present invention relates to: an image encoding method and an imageencoding device for encoding an image; and an image decoding method andan image decoding device for decoding encoded image data.

BACKGROUND ART

As techniques of converting image and speech information into digitaldata and then recording and transmitting the data, the H.264/AVC(Advanced Video Coding) standard and the like have so far been setforth. For the purpose of realizing a compression ratio exceeding this,ISO/IEC MPEG and ITU-T VCEG have established JCT-VC (Joint CollaborativeTeam on Video Coding) and started discussion for a next-generationmethod named HEVC (High Efficiency Video Coding).

As a technical candidate for the HEVC, a method called Motion VectorCompetition has been proposed. The method is a proposal of a predictionvector selection method in a motion prediction mode in an encodingtarget macro block. In the H.264/AVC, a prediction vector has beenacquired from the motion vectors owned by already-encoded macro blockslocated at up, left, and upper right positions relative to the encodingtarget macro block by performing median arithmetic operation on theX-direction component and the Y-direction component.

On the other hand, in the motion vector competition, the motion vectorsof up and left and of the nearest reference frame at the same positionas the encoding target macro block are compared with each other, andthen a vector closest to the motion vector of the encoding target macroblock is selected as a prediction vector and transmitted as a flag.

CITATION LIST Non-Patent Literature

-   NPL 1: I. Amonou, et. al. “Description of video coding technology    proposal by France Telecom, NTT, NTT DOCOMO, Panasonic and    Technicolor”, Doc. JCTVC-A114, Joint Collaborative Team on Video    Coding (JCT-VC), April 2010.

SUMMARY OF INVENTION Technical Problem

Nevertheless, in the motion vector competition method, a flag istransmitted. Thus, when the result of median arithmetic operation isequal to the prediction vector, an increase arises in the amount ofcodes by the amount of the flag.

Further, the method is effective not for all encoding modes using amotion vector.

Further, in a case that the block referred to does not have a motionvector, the processing for the outside of the frame region and themethod of describing the flag are not efficient. Further, in thismethod, two are selected from three candidates and then the flag isrecorded. Thus, the candidate blocks are selected only from a smallregion. This causes the problems of a large prediction error, a largeamount of codes, and a low encoding efficiency.

The present invention has been devised in view of the above-mentionedproblems. An object of the present invention is to provide an imagecoding technique and an image decoding technique that employ suitablemotion prediction so as to realize a high encoding efficiency.

Solution to Problem

The present application includes various kinds of means of resolving theabove-mentioned problems. One of them is as follows.

An image encoding device for encoding an input image, including: amotion search section for performing motion search by using an encodingtarget block obtained by dividing the input image and a reference image;an adaptive PMV selection section for predicting a motion vector of theencoding target block from motion vectors of candidate blocks composedof a part or all of blocks located in the surroundings of the encodingtarget block, and thereby generating a prediction motion vector; and aPMV prediction encoding section for calculating a differential vectorfrom the motion vector of the encoding block and the prediction motionvector and then performing encoding, wherein the adaptive PMV selectionsection includes first means of changing the number or positions of thecandidate blocks to be used or alternatively setting into a zero vectorthe motion vector of the candidate block to be used.

Advantageous Effects

According to the present invention, the encoding efficiency can beimproved.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram of an image encoding device according toEmbodiment 1.

FIG. 2 is a block diagram of an image decoding device according toEmbodiment 2.

FIG. 3 is an explanation diagram of candidate blocks in which a motionvector is selected as a PMV (prediction motion vector) according toEmbodiment 1.

FIG. 4 is an explanation diagram concerning outlines of scene analysisaccording to Embodiment 1.

FIG. 5 is an image encoding flow chart employed in an image encodingdevice according to Embodiment 1.

FIG. 6 is a flowchart of an image decoding method according toEmbodiment 2.

FIG. 7 is an explanation diagram of a data recording medium according toEmbodiment 3.

FIG. 8 is a diagram showing a frame-by-frame PMV selection determinationflow in an adaptive PMV selection section according to Embodiment 1.

FIG. 9 is a diagram showing a block-by-block PMV selection determinationflow in an adaptive PMV selection section according to Embodiment 1.

FIG. 10 is a diagram showing an adjustment flow for candidate blocks inwhich PMV selection is performed block by block in an adaptive PMVselection section according to Embodiment 1.

FIG. 11 is a diagram showing an example of the method of describing as aflag a selected vector according to Embodiment 1.

DESCRIPTION OF EMBODIMENTS

Embodiments are described below with reference to the drawings.

Further, in the individual drawings, components designated by the samenumeral have the same function.

Further, the expression “motion vector competition” in the descriptionand the drawings of the present specification indicates a conventionalencoding method. The expression “adaptation motion vector selection”indicates a new encoding method according to the present invention. “PMVselection” indicates that one is selected from motion vectors owned bycandidate blocks and then a predicted motion vector (PMV) is generated(including situations that a median or the like is employed intact butselectively and that a new vector is generated by combining or the likea plurality of motion vectors) from the selected motion vector.

Further, “0-vec” or “zero vector” in the description and the drawings ofthe present specification indicates a vector whose components have zerovalues, or alternatively indicates conversion or setting into such avector.

Further, “non-referenceable” in the description and the drawings of thepresent specification indicates that information concerning a block isnot acquirable. Particular examples of this include a situation that theposition of a candidate block falls outside a screen region. On thecontrary, “referenceable” indicates that information concerning a blockis acquirable.

Further, “information of a block” in the description and the drawings ofthe present specification includes a vector and a reference framenumber.

Further, the expression “residual component” in the description and thedrawings of the present specification includes also a meaning similar toa “prediction error”.

Further, the expression “region” in the description and the drawings ofthe present specification includes also a meaning similar to an “image”.

Further, the expression “to transmit together with a flag” in thedescription and the drawings of the present specification includes alsothe meaning “to transmit in a state of being contained in a flag”.

Further, the expression “encoding mode” in the description and thedrawings of the present specification includes a combination of the typeof intra prediction/inter prediction and a block size to be applied.

Embodiment 1

First, a first embodiment is described below with reference to thedrawings.

FIG. 1 shows a block diagram of an image encoding device according toEmbodiment 1.

The image encoding device includes a block dividing section 101, aprediction error calculation section 102, an intra prediction section104, a PMV prediction encoding section 107, an adaptive PMV selectionsection 106, a motion search section 105, a decoded image memory 103, aDCT transformation section 108, a quantization section 109, an entropyencoding section 110, an inverse quantization section 111, an inverseDCT transformation section 112, a mode selection section 113, and a dataoutput section 114.

The operation of the individual components of the image encoding deviceis described below in detail.

Here, the operation of the individual components of the image encodingdevice may be, for example, of autonomous operation of the individualcomponents as described below. Further, the operation may be implementedby cooperation between a control section of a computer and softwarestored in a storage section of the computer.

First, the block dividing section 101 receives an original image servingas an encoding target and then divides this into blocks serving as unitsof encoding. The size of a block obtained here by dividing is of a powerof 2 such as 16×16 pixels named a Coding Unit (CU) or a Prediction Unit(PU) (a block of mpixelsxn pixels, m, n=power of 2, e.g., 128×128,64×64, 32×32, 16×16, 16×8, 8×16, 8×8, 4×4). However, the size isvariable, and blocks of mutually different sizes may be adjacent to eachother. The following description is given for an example that blocks ofthe same size succeed to each other. Then, the method of vectorselection in the case of mutually different sizes is describedseparately.

The prediction error calculation section 102 acquires a differencebetween a generated predicted image and the original image, and therebycalculates and outputs a residual component. In general, predictionmethods are intra (intra-frame) prediction and inter (inter-frame)prediction. Intra prediction is performed by the intra predictionsection 104. Inter prediction is performed by an inter predictionsection 120 constructed from the PMV prediction encoding section 107,the adaptive PMV selection section 106, and the motion search section105. Intra prediction uses information of the same frame having beenencoded before the encoding target block. Inter prediction usesinformation of a frame that has been encoded before the encoding targetframe and that is positioned before or after in terms of reproductiontime. These are stored in the decoded image memory 103.

Here, the intra prediction section 104, the inter prediction section,and the decoded image memory 103 have been in a singular number for thepurpose of description. However, these may be provided respectively foreach encoding mode and each frame.

The intra prediction section 104, by using the information of the sameframe encoded before the encoding target block, predicts the pixels ofthe encoding target block. The employed method of intra prediction maybe of an existing method.

In the inter prediction section 120, first, the motion search section105 searches for a motion vector (MV) by using a reference frame and theencoding target block stored in the decoded image memory 103. Theprecision of the pixel may be an integer or a decimal fraction. A¼-pixel precision is preferable by interpolation of a reference framewith a filter. Instead, ½ or ⅛ may be employed. In the presentembodiment, the motion searching method is an existing one.

Then, the adaptive PMV selection section 106, by using the informationof the surrounding blocks located in the same frame of the encodingtarget block and the blocks located at the same position of thereference frame and in the surroundings, a PMV is selected adaptively bytime and spatial distinction. In the present embodiment, both of timedistinction and spatial distinction are employed, and then adaptivedistinction is performed on a PMV. However, any one of these may beemployed. Details of the method, surrounding blocks serving ascandidates, and the method of PMV selection are described later.

An example of candidate blocks from which a PMV is selected is describedbelow with reference to FIG. 3. In an existing motion vector competitionmethod, as shown in 301, the left block (A) and the upper block (B)located in the same encoding target frame as the encoding target blockand the block (Co-located Block) (S) located at the same position as theencoding target block of the nearest forward reference frame (L0[0]) areadopted as candidates. Then, these are arranged sequentially like A, B,and S. When identical vectors are included in these, it is excluded fromthe candidates. Then, one closest to the vector of the encoding targetblock is selected and indicated by a flag. Here, the nearest forwardreference frame has been adopted in the present embodiment. However, abackward reference frame may be adopted as candidates by flag as long asit is an already-encoded frame. Further, instead of one frame, aplurality of encoded frames may be referred to.

On the other hand, in the adaptation motion vector selection methodemployed in the adaptive PMV selection section of the presentembodiment, as shown in 302, in addition to the left and the upperblocks of the encoding target block, the upper right (C) and the upperleft (D) are also included in the candidates. Further, the surroundingblocks of the block S of the reference frame may also be included in thecandidates. That is, (a) the number, (b) the spatial positions (blocksin the frame), and (c) the time positions (blocks in another frame) ofcandidate blocks used in the adaptive PMV selection section arechangeable. Details of the method of selection are described later.

Further, in the adaptation motion vector selection method of the presentembodiment, as shown in 303, in a case that the candidate blocks havemutually different sizes and that the block located at a position to befirst referred to does not have a motion vector or is non-referenceable,it is sequentially checked whether nearby blocks have a motion vector.Then, when it is usable, it is adopted as a candidate of PMV selection.Specifically, in 303, when B1 is non-referenceable, B2, B3, and B4 arechecked sequentially. Similarly, when A1 is non-referenceable, A2, A3,and A4 are checked. When S1 is non-referenceable, S2, S3, and S4 arechecked. Scanning may be performed toward a near block starting at theupper left of the encoding target frame. In the case of blocks B, theorder is from left to right and from down to up. In the case of blocksA, the order is from up to down and from right to left. In the case ofblocks S, the order is of ordinary raster scan, that is, from left toright and from up to down.

Then, the PMV prediction encoding section 107 subtracts the PMV from theMV so as to calculate a differential vector (Differential Motion Vector:DMV), and then encodes this. Further, by using the MV, motion predictionis performed from the reference frame so that a prediction block isgenerated.

The DCT transformation section 108 performs DCT transformation on theresidual component inputted from the prediction error calculationsection 102, and thereby converts the residual component intocoefficients. Then, the transform coefficients are transmitted to thequantization section 109 and then quantized. The quantized coefficientsare transmitted to the entropy encoding section 110 and then undergoinformation compression using a variable length code or the like in afixed sequence. The data is transmitted to the mode selection section113. On the other hand, the quantized coefficients are transmitted alsoto the inverse quantization section 111 so as to be returned to thetransform coefficients by inverse quantization, and further restored tothe residual component by the inverse DCT transformation section 112.Together with information from the intra prediction section 104 and aseries of the inter prediction sections, the residual component isreturned to a decoded image and then stored into the decoded imagememory 103. The decoded image is inputted to the mode selection section113 and then used for mode selection.

Then, on the basis of information concerning a plurality of encodingmodes, the mode selection section 113 selects a mode that realizes thehighest encoding efficiency for the block. For each encoding mode, anerror (encoding error) between the original image and the decoded imageand the amount of codes generated when the encoding mode is adopted arecalculated, and then a suitable encoding mode is selected on the basisof the relation of the two. For example, as the method of selecting anencoding mode that realizes the highest encoding efficiency, an existingmethod such as the Rate-Distortion optimization method may be employed.In this method, the amount of codes and the encoding error of thedecoded image from the original are calculated for each macro block forall modes, and then the most satisfactory mode is selected in accordancewith a cost calculation formula.

Finally, the data output section 114 outputs the selected codes so thatan encoded stream is generated and encoding of an image is completed.

Next, an image encoding flow employed in the image encoding device isdescribed below with reference to FIG. 5.

First, Step 501 is a processing that an original image serving as anencoding target is inputted from the decoded image memory 103 and thendivided into blocks. Here, the size of each block is variable. That is,the above-mentioned CU or PU may be employed. The Step 501 is executedby the block dividing section 101.

Then, at Step 502, intra prediction is performed on the block of theoriginal image acquired at Step 501. The employed method of intraprediction may be existing one. In accordance with the individual intraprediction modes, prediction is performed for a plurality of modes. Thisprocessing of Step 502 is executed by the intra prediction section 104.

Then, at Step 503, a residual component is acquired for the pixels ofthe encoding block having undergone intra prediction, and then DCTtransformation processing, quantization processing, and entropy encodingprocessing are performed on the residual component so that encoded datais calculated. Further, entropy decoding processing, inversequantization, and inverse DCT transformation processing are performed onthe encoded data so that a decoded image is generated. Then, the encodeddata and the decoded image are outputted. Each processing of Step 503 isperformed by the prediction error calculation section 102, the DCTtransformation section 108, the quantization section 109, and theentropy encoding section 110 in this order.

At Step 504, scene analysis is performed. Outlines of scene analysis aredescribed below with reference to FIG. 4. In a video image sequence, insome cases, even within one GOP (Group of Picture: a group of frameswith respect to prediction in the time direction), a change arises inthe feature of the image. For example, a scene change in a movie or adrama or alternatively switching of cameras in a live telecast couldoccur. FIG. 4 shows a situation that switching of a scene 1 and a scene2 occurs between a frame P2 and a frame B3. Here, in an existing motionvector competition method, the frame P4 or B3 refers to the motionvector of the P2 frame. Nevertheless, since the scenes are differentfrom each other, an effective motion vector is not acquired. Thus, inthe present embodiment, a plurality of decoded images are analyzed sothat a scene change is found without using a flag. Alternatively, theposition of a scene change detected as a result of scene analysisperformed by the encoder side may be notified to the decoder by using aflag, and then when the encoding target frame and the reference framebelong to mutually different frames, this block is not adopted as acandidate block of PMV. Such processing of scene analysis may beperformed frame by frame or alternatively block by block. Although notshown as a distinct block, this processing is executed before the motionsearch section 105 in the inside of the inter prediction section 120performs motion search.

Then, at Step 505, motion search is performed for each inter predictionmode. Inter prediction modes include a motion prediction mode formutually different block sizes, a Skip mode, and a Direct mode. Theemployed method of motion search may be of an existing method. This Step505 is executed by the motion search section 105 in the inter predictionsection 120.

Then, at Step 506, it is determined whether PMV selection is to beperformed frame by frame. When PMV selection is not to be performed, theprocedure goes to Step 510. Otherwise, the procedure goes to Step 507.Then, at Step 507, it is determined whether PMV selection is to beperformed block by block. When PMV selection is not to be performed, theprocedure goes to Step 510. Otherwise, the procedure goes to Step 508.Further, at Step 508, adjustment of PMV candidate blocks is performed sothat in accordance with a condition, it is determined which block is tobe included into the candidate blocks and which block is not to beincluded. This processing is changeable frame by frame and block byblock. This switching may be transmitted to the decoding device side byusing a flag. Alternatively, the same switching condition may be held inthe decoding device.

Details of frame-by-frame PMV selection determination are describedbelow with reference to FIG. 8. At Step 801, whether a scene change ornot is determined so that whether PMV selection is to be performed isdetermined. At this time, scene analysis processing may be performed bythe decoder side as described above so that whether PMV selection is tobe performed may be determined without transmission of a flag.

Alternatively, determination performed by the encoder side may benotified to the decoder side by using a flag so that determination maybe achieved. When PMV selection is not to be performed, a particularmethod to be employed is determined in advance like the method ofcalculating a PMV by median arithmetic operation and the method ofadopting as a PMV the vector of a left or upper block having been setforth in advance.

Further, in another example, at Step 802, a picture type is determinedso that whether PMV selection is to be performed is determined. At thistime, for example, when the encoding target frame is a P picture, motionvector prediction by PMV selection is performed. Otherwise, anothermeans is adopted like median arithmetic operation. A B picture may beemployed in place of the P picture. A flag may be provided fordiscriminating which kind of determination is to be performed for whichtype picture.

Details of block-by-block PMV selection determination are describedbelow with reference to FIG. 9. At Step 901, the type of encoding modeof the encoding target block is distinguished so that whether PMVselection is to be performed is determined. For example, PMV selectionmay be performed only in the case of a particular block size.Alternatively, PMV selection may not be applied in a Skip mode or aDirect mode.

Further, in another example, at Step 902, the type of encoding mode of acandidate block is distinguished so that whether PMV selection is to beperformed is determined. For example, when all candidate blocks are inthe intra encoding mode, PMV selection is not performed.

According to the above-mentioned methods, whether PMV selection is to beperformed frame by frame or block by block is switchable.

Details of the method of adjustment of candidate blocks in which PMVselection is performed block by block are described below with referenceto FIG. 10. In this processing, at the time of PMV selection, dependingon the encoding mode of a candidate block, whether a candidate block hasa vector, or whether a candidate block is referenceable, the block isexcluded from the candidate blocks or another candidate block is added.

First, at Step 1001, from the candidate blocks of the encoding targetframe, for example, from. A and B in FIG. 3, one block having not yetbeen checked is selected. This is referred to as a block X.

Then, at Step 1002, it is checked whether the block X is referenceable.When the block is non-referenceable, the procedure goes to Step 1003.When the block is referenceable, the procedure goes to Step 1004. Theterm “non-referenceable” indicates a state that the information of theblock is not acquirable because, for example, the block position islocated outside the screen. The term “referenceable” indicates asituation that the information of the block is acquirable. Theinformation of the block includes the vector and the reference framenumber.

At Step 1003, the block X is set as a zero vector or alternativelyexcluded from the candidate blocks. Which operation is to be performedis determined in advance. For example, at Step 1003, the block is set asa zero vector. The “zero vector” is a vector whose individual componentshave the value of 0.

At Step 1004, it is checked whether the block X has a vector. Intraencoded blocks do not have a vector. When the block does not have avector, the procedure goes to Step 1005. When the block has a vector,the procedure goes to Step 1006.

At Step 1005, the block X is set as a zero vector or alternativelyexcluded from the candidate blocks. Which operation is to be performedis determined in advance. For example, at Step 1005, the block isexcluded from the candidate blocks.

At Step 1006, it is checked whether the reference frame numbers of theblock X and the encoding target block agree with each other. Forexample, the encoding target block is of one-directional prediction andthe block X is of bidirectional prediction, it is sufficient that eitherL0 or L1 is in agreement. Further, when the encoding target block is ofbidirectional prediction and the block X is of one-directionalprediction, disagreement is concluded. In the case of disagreement, theprocedure goes to Step 1007. In the case of agreement, the proceduregoes to Step 1008.

At Step 1007, the block X is set as a zero vector or alternativelyexcluded from the candidate blocks. Which operation is to be performedis determined in advance. For example, at Step 1007, the block isexcluded from the candidate blocks.

At Step 1008, it is determined whether another candidate block to bechecked is present in the encoding target frame. When another block tobe checked is present, the procedure returns to Step 1001. Otherwise,the procedure goes to Step 1009.

At Step 1009, from the candidate blocks of the reference frame, forexample, from S in FIG. 3, one block having not yet been checked isselected. This is referred to as a block Y.

At Step 1010, it is checked whether the block Y has a vector. Intraencoded blocks do not have a vector. When the block does not have avector, the procedure goes to Step 1011. When the block has a vector,the procedure goes to Step 1012.

At Step 1011, the block Y is set as a zero vector or alternativelyexcluded from the candidate blocks. Which operation is to be performedis determined in advance. For example, at Step 1011, the block isexcluded from the candidate blocks.

At Step 1012, it is checked whether the reference frame numbers of theblock Y and the encoding target block agree with each other. Forexample, the encoding target block is of one-directional prediction andthe block Y is of bidirectional prediction, it is sufficient that eitherL0 or L1 is in agreement. Further, when the encoding target block is ofbidirectional prediction and the block Y is of one-directionalprediction, disagreement is concluded. In the case of disagreement, theprocedure goes to Step 1013. In the case of agreement, the proceduregoes to Step 1014.

At Step 1013, the block Y is set as a zero vector or alternativelyexcluded from the candidate blocks. Which operation is to be performedis determined in advance. For example, at Step 1013, the block isexcluded from the candidate blocks.

At Step 1014, it is checked whether the encoding target block or theblock Y is in a bidirectional prediction mode. When any one is in thebidirectional prediction mode, the procedure goes to Step 1015.Otherwise, the procedure goes to Step 1016.

At Step 1015, the block Y is set as a zero vector or alternativelyexcluded from the candidate blocks. Which operation is to be performedis determined in advance. For example, at Step 1015, the block isexcluded from the candidate blocks.

At Step 1016, it is determined whether another candidate block to bechecked is present in the reference frame. When another block to bechecked is present, the procedure returns to Step 1009.

Here, in correspondence to the individual conditions, at Steps 1003,1005, 1007, 1011, 1013, and 1015, the block X or the block Y was set asa zero vector or alternatively excluded from the candidate blocks. Incontrast, as a candidate block, for example, the block located at theposition C or D in FIG. 3 may be added to the candidate blocks. Forexample, among S, A, and B, when the number of candidate blocks is 0, Cand D are added to the candidate blocks. When the number of candidateblocks is 1, C is added to the candidate blocks. C, D, and other blocksmay be added in advance to the candidate blocks, and then a vector maybe selected from them.

For example, when the picture of L0[0] has been intra encoded, S isexcluded from the candidate blocks and, instead, C may be added.Alternatively, when the block A is non-referenceable, the block C may beused.

As for whether the above-mentioned PMV selection is to be performed oras for the method of candidate block adjustment, the method having beendetermined in advance may be switched frame by frame or block by blockby using a flag. That is, the following methods are employable.

-   -   The methods are unified into any one method.    -   The method is made switchable frame by frame and a selected        method is indicated by a flag.    -   The method is made switchable block by block and a selected        method is indicated by a flag.

The conditions shown in FIG. 10 are as follows. The order ofdetermination of these may be changed.

-   -   Whether the candidate block is non-referenceable.    -   Whether the candidate block has a motion vector.    -   Whether the candidate block and the encoding target block have        mutually different coding types (e.g., the candidate block is of        bidirectional prediction (B prediction) and the encoding target        block is of one-directional prediction (P prediction)).    -   Whether the reference frame numbers of the candidate block and        the encoding target block agree with each other.    -   Whether the candidate block or the encoding target block are of        bidirectional prediction.

The following methods of candidate block adjustment are employable.

-   -   The candidate block is excluded from the candidate blocks.    -   The vector of the candidate block is processed as a zero vector.    -   Another block located in the encoding target frame is added to        the candidate blocks.    -   Another block located in the reference frame is added to the        candidate blocks.    -   Another block shown in 303 of FIG. 3 is added to the candidate        blocks.    -   Only when the coding types agree with each other, the processing        is performed. Otherwise, the block is excluded from the        candidate blocks.    -   Only when the reference frame numbers agree with each other, the        processing is performed. Otherwise, the block is excluded from        the candidate blocks.    -   Only when the encoding target block is of bidirectional        prediction, the candidate block and its vector are selected by        reference frame number of target block

Then, at Step 509, a PMV is selected and then a differential vector iscalculated and encoded. As the PMV, a vector nearest to the vector ofthe encoding target block is selected from the vectors of the candidateblocks. A vector is selected in which the smallest amount of codes isobtained when the individual components of the vector is encoded. Theselected vector is transmitted as a flag. This indicates that when thecandidate blocks are arranged sequentially, in the case of one bit, thevector of the candidate block at the beginning is selected in the caseof 0 and that the vector of the next candidate block is selected in thecase of 1. For example, in the case that the blocks A and B, or A, B,and S are incorporated, the order of arrangement of candidate blocks issuch that A and B, or A, B, and S are arranged in this order. Then, whenidentical vectors are included, it is excluded. Then, two blocks at thebeginning are arranged sequentially and compared.

The following description is given for a case that the selected vectoris expressed in 2 bits. It is assumed that candidate blocks are fourblocks A, B, S, and C shown in 302 in the figure. Similarly to theabove-mentioned example, a vector nearest to the vector of the encodingtarget block is selected and then the codes are transmitted in the formof A:00, B:01, C:10, and S:11 or the like. For example, when any one ofthese is to be excluded from the candidate blocks, the order of theblocks is advanced. The number of bits expressing the selected vectormay be changed frame by frame and block by block. In this case, a flagindicating the switching is transmitted separately.

FIG. 11 shows an example of the method of describing the code of theselected vector. The candidate block number of the encoding target blockimmediately preceding the present one is denoted by P. The number ofcandidate blocks is denoted by N. The candidate block number of thepresent encoding target block is denoted by X. When the candidate blocknumber of the present encoding target block is P, 0 is adopted as thecode C. Otherwise, 1 is outputted first and then (X-P-1)% N is outputtednext. In reverse, when the code C is 0, the candidate block number X ofthe present encoding target block is the same as the candidate blocknumber P of the immediately preceding one. Instead, in a case that thebeginning bit of the code C is 1, when the remaining code where thebeginning bit has been removed is denoted by Ĉ, X=(P+Ĉ+1)% N holds.According to this approach, the amount of codes is shortened when thesame candidate block number is selected successively.

Here, the processing of Step 506 to Step 509 is executed by the adaptivePMV selection section 106.

Then, at Step 510, PMV calculation and vector encoding are performed.Here, PMV selection is not performed and PMV calculation is performed byordinary median arithmetic operation. In this method, median arithmeticoperation is performed on the individual components of the vector of theleft A, the upper B, the upper right C, or the upper left D so that aPMV is determined. After the PMV is determined, a differential vectorrelative to the vector of the encoding target block is calculated andencoded. The processing of Step 510 is executed by the PMV predictioncoding section 107.

At Step 511, motion prediction is performed for each inter predictionmode, then a residual component is acquired for the pixels of theencoding block, and then DCT transformation processing, quantizationprocessing, and entropy encoding processing are performed on theresidual component so that encoded data is calculated. Theabove-mentioned processing included in Step 511 is executed by the DCTtransformation section 108, the quantization section 109, and theentropy encoding section 110. Further, entropy decoding processing,inverse quantization, and inverse DCT transformation processing areperformed on the encoded data so that a decoded image is generated.Then, the encoded data and the decoded image are outputted. Theabove-mentioned processing included in Step 511 is performed by theinverse quantization section 111 and the inverse DCT transformationsection 112.

Then, at Step 512, in accordance with the processing result of Step 503and Step 511, the image coding results in the individual encoding modesare compared with each other so that an encoding mode to be outputtedfor the block is determined. The processing of Step 512 is executed bythe mode selection section 113.

Then, at Step 513, the encoded data in the encoding mode selected atStep 512 is outputted as an encoded stream. The processing of Step 513is executed by the data output section 114.

The encoding processing according to Embodiment 1 is performed asdescribed above.

According to the image encoding device and the image encoding methodaccording to Embodiment 1 described above, inter prediction is achievedthat realizes a higher precision and a smaller amount of codes thanexisting encoding methods. This realizes an image encoding device and animage encoding method having a higher compression efficiency thanexisting methods.

Further, the image encoding device and the image encoding methodaccording to Embodiment 1 are applicable to a recording device, aportable phone, a digital camera, and the like employing them.

According to the image encoding device and the image encoding methodaccording to Embodiment 1 described above, the amount of codes of theencoded data is reduced and degradation in the image quality of thedecoded image obtained when the encoded data is decoded is avoided. Thatis, a high compression ratio and a more satisfactory image quality arerealized.

Embodiment 2

Next, FIG. 2 shows an example of a block diagram of an image decodingdevice according to Embodiment 2.

The image decoding device of the present embodiment includes a streamanalyzing section 201, a mode determination section 202, a coefficientanalyzing section 203, an intra prediction synthesizing section 204, anadaptive PMV selection decoding section 205, a motion predictionsynthesizing section 206, an inverse quantization section 207, aninverse DCT transformation section 208, a decoded image memory 209, andan image output section 210.

The operation of the individual components of the image decoding deviceis described below in detail. Here, the operation of the individualcomponents of the image decoding device may be, for example, ofautonomous operation of the individual components as described below.Further, for example, the operation may be implemented by cooperationbetween a control section of a computer and software stored in a storagesection.

First, the stream analyzing section 201 analyzes an inputted encodedstream. Here, the stream analyzing section 201 performs also dataextraction processing from the packet and information acquisitionprocessing for various kinds of headers and flags. Further, processingof each block is performed.

Further, at that time, the encoded stream inputted to the streamanalyzing section 201 is an encoded stream generated by the imageencoding device and the image encoding method according to Embodiment 1.The method of generation has been described in Embodiment 1. Thus,description thereof is omitted. An encoded stream read from a datarecording medium shown in Embodiment 3 may be employed. The method ofrecording is described later.

Then, for each block, the mode determination section 202 distinguishesthe encoding mode specified by a flag or the like. In the subsequentdecoding processing, processing corresponding to the encoding mode ofthe discriminated result is performed. Processing for each encoding modeis described below.

First, when the encoding mode is of intra encoding, the intra predictionsynthesizing section 204 performs intra prediction and synthesis of apredicted image. This method may be of a conventional method. Here, theintra prediction synthesizing section 204 outputs the synthesizedpredicted image.

When the encoding mode is of encoding by inter prediction forinter-frame processing, motion prediction and synthesis of a predictedimage are performed. First, the adaptive PMV selection decoding section205 adaptively selects a PMV and then combines this with a decodeddifferential vector so as to restore a motion vector. As for the methodof PMV selection, the encoder and the decoder operate and select thesame PMV. Thus, a method similar to that described in Embodiment 1 isemployed.

Then, by using the restored motion vector, the motion predictionsynthesizing section 206 performs motion prediction on the pixels withina block by using a reference frame. Here, the motion predictionsynthesizing section 206 outputs a synthesized predicted image.

On the other hand, the coefficient analyzing section 203 analyzes theencoded data of each macro block contained in the inputted encodedstream, and then outputs the encoded data of a residual component. Atthat time, processing is performed in correspondence to the encodingmode of the discriminated result of the mode determination section 202.

The inverse quantization section 207 performs inverse quantizationprocessing on the encoded data, and then transmits the result to theinverse DCT transformation section 208. The inverse DCT transformationsection 208 performs inverse DCT transformation on the inverse-quantizedcoefficients so as to restore the residual component.

The above-mentioned restored residual component of each encoding mode isadded to the predicted image outputted from the intra predictionsynthesizing section 204 or the motion prediction synthesizing section206 so that the decoded image is restored and then stored into thedecoded image memory 209. The decoded image memory 209 stores theinformation of a frame presently under decoding and the information offrames decoded in the past. This information is referred to by the intraprediction synthesizing section 204 or the motion predictionsynthesizing section 206.

The image decoded at the last is outputted by the image output section210, and then decoding of the image is performed.

Next, the flow of the image decoding method employed in the imagedecoding device according to Embodiment 2 is described below withreference to FIG. 6.

First, at Step 601, an encoded stream serving as a decoding target isacquired. Then, at Step 602, the encoding mode flag and the encoded datacontained in the encoded stream acquired at Step 601 are analyzed. TheseStep 601 and Step 602 are executed by the stream analyzing section 201.

Then, at Step 603, by using the encoding mode flag analyzed at Step 602,the encoding mode is determined for one encoding unit (such as a blockunit and a pixel unit) contained in the encoded data. Here, in the caseof intra encoding mode, the procedure goes to Step 604. In the case ofinter encoding mode, the procedure goes to Step 605. This Step 603 isexecuted by the mode determination section 202.

At Step 604, intra prediction is performed in accordance with the methodspecified in the encoding mode. At that time, an existing intraprediction method may be employed. This Step 604 is executed by theintra prediction synthesizing section 204.

At Step 605, in accordance with various kinds of conditions in eachframe and the information of the flag, it is determined whether PMVselection is to be performed on the frame. As for the determination ofwhether the PMV selection is to be performed frame by frame, the encoderand the decoder operate and perform the same processing. Thus, a methodsimilar to that described in Embodiment 1 is employed. When PMVselection is not to be performed, the procedure goes to Step 609.Otherwise, the procedure goes to Step 606. At Step 606, in accordancewith the encoding mode, various kinds of conditions in each block, andthe information of the flag, it is determined whether PMV selection isto be performed on the block. As for the determination of whether thePMV selection is to be performed block by block, the encoder and thedecoder operate and perform the same processing. Thus, a method similarto that described in Embodiment 1 is employed. When PMV selection is notto be performed, the procedure goes to Step 609. Otherwise, theprocedure goes to Step 607.

At Step 607, adjustment of the PMV candidate blocks is performed. Here,which block is to be included into the candidate blocks and which blockis not to be included are determined in accordance with the conditions.In the adjustment of the PMV candidate blocks, the encoder and thedecoder operate and perform the same processing. Thus, a method similarto that described in Embodiment 1 is employed.

At Step 608, PMV selection and vector decoding are performed. As for themethod of PMV selection, the encoder and the decoder operate and performthe same processing. Thus, a method similar to that described inEmbodiment 1 is employed. In the decoding of the vector, the PMV and thedecoded differential vector are combined with each other so that themotion vector of the encoding target block is restored.

Then, at Step 609, PMV calculation and vector decoding are performed. Asfor the method of PMV calculation, the encoder and the decoder operateand perform the same processing. Thus, a method similar to thatdescribed in Embodiment 1 is employed. In the decoding of the vector,the PMV and the decoded differential vector are combined with each otherso that the motion vector of the encoding target block is restored.These Step 605, Step 606, Step 607, Step 608, and Step 609 are executedby the adaptive PMV selection decoding section 205.

At Step 610, by using the restored vector and the reference frame, interprediction is performed so that a predicted image is synthesized. Thisprocessing is achieved when in response to the determined encoding mode,the intra prediction synthesizing section 204 and the motion predictionsynthesizing section 206 of the image decoding device in FIG. 2 performsynthesizing processing for a predicted image respectively in the caseof a corresponding encoding mode. This Step 610 is executed by themotion prediction synthesizing section 206.

At Step 611, the predicted image and the residual component are combinedwith each other so that a decoded image is generated. First, the encodeddata is analyzed. Then, inverse quantization processing and inverse DCTtransformation processing are performed on the encoded data. Then,decoding of the residual component is performed for one encoding unit.Then, the predicted image is combined with the result so that a decodedimage is generated and stored into the memory. At last, at Step 612, thegenerated decoded image is outputted. This processing of Step 611 isexecuted by the coefficient analyzing section 203, the inversequantization section 207, the inverse DCT transformation section 208,the decoded image memory 209, and the image output section 210.

Here, also in the present embodiment, in addition to the examples givenabove, an encoded stream whose encoding mode is set forth in asubdivided manner, for example, by adopting as a parameter the size orthe like of the block used in the encoding mode may be employed as adecoding target stream.

According to the image encoding device and the image decoding methodaccording to Embodiment 2 described above, inter prediction is achievedthat realizes a higher precision and a smaller amount of codes thanexisting decoding methods. This realizes an image decoding device and animage decoding method having a higher compression efficiency thanexisting methods.

Further, the image decoding device and the image decoding methodaccording to Embodiment 2 are applicable to a reproducing device, aportable phone, a digital camera, and the like employing them.

According to the image decoding device and the image decoding methodaccording to Embodiment 2 described above, encoded data composed of asmall amount of codes is decoded in a higher image quality.

Embodiment 3

Next, FIG. 7 shows a data recording medium storing an encoded streamgenerated by an image encoding device or an image encoding methodaccording to Embodiment 1.

The encoded stream according to the present embodiment is an encodedstream generated by the image encoding device or the image encodingmethod according to Embodiment 1. The method of generation has beendescribed in Embodiment 1. Thus, description thereof is omitted.

Here, the encoded stream according to the present embodiment is recordedas a data sequence 702 on a data recording medium 701. The data sequence702 is recorded as an encoded stream according to a predeterminedsyntax. The following description is given for a case that a part ofH.264/AVC standard is modified.

First, in H.264/AVC, a stream is constructed from a sequence parameterset 703, a picture parameter set 704, and slices 705, 706, and 707. Thefollowing description is given for a case that one slice stores oneimage (one picture).

In the inside of each slice, information 708 concerning each block iscontained. In the inside of the information 708 concerning the block, aregion is present for recording the encoding mode for each block. Thisis referred to as an encoding mode flag 709.

According to the data recording medium according to Embodiment 3described above, recording is achieved in the form of an encoded streamhaving a higher compression efficiency than existing methods. Thispermits recording of a larger number of images.

Here, any ones of the above-mentioned embodiments of methods and figuresmay be combined.

REFERENCE SIGN LIST

101 . . . block dividing section, 102 . . . prediction error calculationsection, 103 . . . decoded image memory, 104 . . . intra predictionsection, 105 . . . motion search section, 106 . . . adaptive PMVselection section, 107 . . . PMV prediction encoding section, 108 . . .DCT transformation section, 109 . . . quantization section, 110 . . .entropy encoding section, 111 . . . inverse quantization section, 112 .. . inverse DCT transformation section, 113 . . . mode selectionsection, 114 . . . data output section, 120 . . . inter predictionsection, 201 . . . stream analyzing section, 202 . . . modedetermination section, 203 . . . coefficient analyzing section, 204 . .. Intra prediction synthesizing section, 205 . . . adaptive PMVselection decoding section, 206 motion prediction synthesizing section,207 . . . inverse quantization section, 208 . . . inverse DCTtransformation section, 209 . . . decoded image memory, 210 . . . imageoutput section

1. An image decoding method for decoding a coded stream including anencoded picture, comprising: a first step for determining a motionvector of a target block to be decoded, by selecting a motion vectoramong motion vectors of candidate blocks including adjacent blocksadjacent to the target block to be decoded, according to coding modeinformation obtained from the coded stream; and a second step forgenerating a prediction image by using the motion vector of the targetblock to be decoded and a reference picture, wherein, in a motion vectorselection process of the first step, candidate blocks are selected amongfirst blocks adjacent to the target block to be decoded in the sameframe as the target block to be decoded and a second block located atthe same position of the target block to be decoded in a different framefrom the target block to be decoded, wherein, in the motion vectorselection process of the first step: excluding a block located on anupper side of the target block to be decoded in the first blocks fromthe candidate blocks based on comparing process showing that the blocklocated on the upper side of the target block to be decoded has the samemotion vector as a block located on a left side of the target block inthe first blocks, excluding a non-referenceable block in the firstblocks from the candidate blocks in the case that the first blocks havea non-referenceable block, and adding another block or blocks to thecandidate blocks, wherein the number of blocks to be added is changedbased on the number of blocks that have been selected as candidateblocks, and wherein if there are a plurality of blocks located on theupper side of the target block, a motion vector of one block among theblocks located on the upper side of the target block is selected as amotion vector to be a target of the comparing process before thecomparing process in the first step.